package library.and.xps.com.step.m.model;

import com.baidu.location.BDLocation;
import com.baidu.mapapi.model.LatLng;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import library.and.xps.com.step.util.MapUtils;

public class Runlog implements Serializable {
    private long mStartTime = 0;//开始时的时间戳
    private ArrayList<Coordinate> mCoordinates = new ArrayList<>();

    /**
     * @param bdlocat
     * 插入一条记录
     * */
    public void insertCoord(BDLocation bdlocat) {
        LatLng latLng = new LatLng(bdlocat.getLatitude(), bdlocat.getLongitude());

        Coordinate coordinate = new Coordinate();
        coordinate.setSpeed(bdlocat.getSpeed());
        coordinate.setColorInSpeed(MapUtils.CulColorInSpeed(bdlocat.getSpeed()));
        coordinate.setAltitude(bdlocat.getAltitude());
        coordinate.setLat(latLng.latitude);
        coordinate.setLng(latLng.longitude);
        mCoordinates.add(coordinate);

    }

    public Runlog() {

    }

    public List<Coordinate> getmCoordinates() {
        return mCoordinates;
    }

    public long getmStartTime() {
        return mStartTime;
    }

    public void setmStartTime(long mStartTime) {
        this.mStartTime = mStartTime;
    }

}
